<template>
	<view
		style="position:absolute;right:8px;bottom:75px;filter:drop-shadow(0px 0px 3.3333327770233154px rgba(255, 31, 66, 0.25));"
		:style="style"
		@click.stop="handleClick"
	>
		<image class="size-40" src="@/static/svg/icon-scroll-to-top.svg"></image>
	</view>
</template>

<script setup>
	import { computed } from 'vue'
	const props = defineProps({
		bottom: {
			type: [Number, String]
		}
	})
	const emits = defineEmits(['backToTop'])
	const style = computed(() => {
		const bottom = typeof props.bottom === 'number' ? `${props.bottom}px` : props.bottom
		return {
			bottom: `calc(64px + ${bottom})`,
		}
	})
	
	const handleClick = () => {
		emits('backToTop')
	}
</script>
